import 'package:equatable/equatable.dart';

/// 基础错误类
abstract class Failure extends Equatable {
  /// 错误消息
  final String message;
  
  /// 构造函数
  const Failure(this.message);
  
  @override
  List<Object> get props => [message];
  
  @override
  String toString() => message;
}

/// 服务器错误
class ServerFailure extends Failure {
  /// 构造函数
  const ServerFailure(String message) : super(message);
}

/// 缓存错误
class CacheFailure extends Failure {
  /// 构造函数
  const CacheFailure(String message) : super(message);
}

/// 网络错误
class NetworkFailure extends Failure {
  /// 构造函数
  const NetworkFailure(String message) : super(message);
}

/// 未授权错误
class UnauthorizedFailure extends Failure {
  /// 构造函数
  const UnauthorizedFailure(String message) : super(message);
}

/// 未找到错误
class NotFoundFailure extends Failure {
  /// 构造函数
  const NotFoundFailure(String message) : super(message);
}

/// 意外错误
class UnexpectedFailure extends Failure {
  /// 构造函数
  const UnexpectedFailure(String message) : super(message);
}

/// 认证错误
class AuthenticationFailure extends Failure {
  /// 构造函数
  const AuthenticationFailure(String message) : super(message);
}

/// 验证错误
class ValidationFailure extends Failure {
  /// 构造函数
  const ValidationFailure(String message) : super(message);
}

/// 权限错误
class PermissionFailure extends Failure {
  /// 构造函数
  const PermissionFailure(String message) : super(message);
}

/// 输入错误
class InputFailure extends Failure {
  /// 构造函数
  const InputFailure(String message) : super(message);
}

/// 数据库错误
class DatabaseFailure extends Failure {
  /// 构造函数
  const DatabaseFailure(String message) : super(message);
}

/// 设备错误
class DeviceFailure extends Failure {
  /// 构造函数
  const DeviceFailure(String message) : super(message);
} 